//
//  JSDSportSportingViewController.m
//  仿咕咚
//
//  Created by Abner on 16/11/8.
//  Copyright © 2016年 Abner. All rights reserved.
//

#import "JSDSportSportingViewController.h"
#import "JSDSportMappingViewController.h"
@interface JSDSportSportingViewController ()

@end

@implementation JSDSportSportingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self loadMapView];
    NSLog(@"%zd",_sportTracking.sportType);
}
- (void)loadMapView{
//    JSDSportMappingViewController *mapVC = [[JSDSportMappingViewController alloc] init];
//    [self addChildViewController:mapVC];
//    [self.view addSubview:mapVC.view];
//    [mapVC didMoveToParentViewController:self];
//    //把图片名称传递过去
//    mapVC.sportTracking = _sportTracking;
    for (UIViewController *vc in self.childViewControllers) {
        if ([vc isKindOfClass:[JSDSportMappingViewController class]]) {
            JSDSportSportingViewController *mapVc = (JSDSportSportingViewController *)vc;
            mapVc.sportTracking = _sportTracking;
            break;
        }
    }
}

- (IBAction)didStateChanged:(UIButton *)sender {
    _sportTracking.sportState = sender.tag;
}
@end
